<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1,.box2{
            width: 200px;
            height: 200px;
            float: left;
        }
        .box1{
            background-color: purple;
        }
        .box2{
            background-color: red;
        }
        .box3{
            width: 400px;
            height: 400px;
            background-color: sandybrown;
            /*
            4.浮动在哪边就清哪边
            清除左浮动对象:left
            清除右浮动对象:right
            不允许有浮动对象:both
            运行有浮动对象:none*/
            /* clear: left; */
        }
        .bn{
            /* 1.写死高度 */
            /* width:200px; */

            /* 3.bfc 让浮动元素计算高度 */
            overflow: hidden;
            }
    </style>
</head>
<body>
    <div class="bn">
        <div class="box1"></div>
        <div class="box2"></div>
        <!-- 2.当前浮动元素后面补一个盒子，不设置宽高 -->
        <!-- <div style="clear: left;"></div> -->
    </div>
    <div class="box3"></div>
</body>
</html>